import mysql.connector
import requests
from copy import deepcopy
import os


def D_info():



    mydb = mysql.connector.connect(

            host = 'IP',
            user = "root",
            passwd = "PASSWORD",
            database = "database"
        )
    cursor = mydb.cursor()

    sql = """


SELECT
    DATE_FORMAT(TIME,'%m-%d %H:%i'),
  
FROM

WHERE
    and to_days(now())-to_days(RD_TIME)<9 and to_days(now())-to_days(RD_TIME)>1
    #and date_format(RD_TIME,'%Y-%m')=date_format(now(),'%Y-%m')

 ORDER BY RD_TIME asc
     """

    cursor.execute(sql)
    rows = cursor.fetchall()
    
    for row in rows:
        print(row)



if __name__ == '__main__':
    D_info()
    